package com.atiguigu.mybatisplus.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import static org.checkerframework.checker.units.UnitsTools.min;

@Configuration
public class MinioConfiguration {
    @Autowired
    MinioProperties minioProperties;
    @Bean
    public MinioClient minioClient() {
        MinioClient minioClient=MinioClient.builder()
                .endpoint(minioProperties.getUrl())
                .credentials(minioProperties.getAccessKey(),minioProperties.getSecretKey())
                .build();

        return minioClient;
    }
}
